home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Just Call Me Internet
/
Just Call Me Internet.iso
/
prog
/
mint
/
duftp
/
main.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-06-17
|
3KB
|
104 lines
/*
DUFTP
*/
#include <DULIB.H>
#include <SETJMP.H>
#include "servers.h"
#include "init.h"
#include "globals.h"
#include "duftp_n.h"
short main(int argc, char *argv[])
{
OBJECT *a;
char rfile[FMSIZE],lfile[FMSIZE],*n;
event e;
server_list *s;
short f;
// CALL INITIALISATION
initialise();
// CENTRAL EVENT LOOP
do{
setjmp(recover_main);
e=WaitEvent();
switch(e)
{
case mev_SELBOOKMARK: // Bookmark selected, update currently displayed info
s=servers;
for(f=1; f<server_count-scroll_selection; f++) s=s->next;
selected_server=s;
set_dialog_text(Mainwindow, This_server, s->name);
set_dialog_text(Hosts, Server_name, s->name);
set_dialog_text(Hosts, Ip_address, s->ip_name);
set_dialog_text(Hosts, Login_name, s->login);
set_dialog_text(Hosts, Login_password, s->password);
set_dialog_text(Hosts, Login_path, s->path);
sprintf(new_server_login,"%s",s->login);
sprintf(new_server_address,"%s",s->ip_name);
sprintf(new_server_password,"%s",s->password);
sprintf(new_server_path,"%s",s->path);
rsrc_gaddr(0,Hosts,&a);
objc_draw(a,Server_name,0,scrn_x,scrn_y,scrn_w,scrn_h);
objc_draw(a,Ip_address,0,scrn_x,scrn_y,scrn_w,scrn_h);
objc_draw(a,Login_name,0,scrn_x,scrn_y,scrn_w,scrn_h);
objc_draw(a,Login_password,0,scrn_x,scrn_y,scrn_w,scrn_h);
objc_draw(a,Login_path,0,scrn_x,scrn_y,scrn_w,scrn_h);
break;
case mev_REMOTEFILE:
n=remote_files[scroll_selection];
if (n[0]!='')
{
n=n+2;
sscanf(n,"%s",rfile);
get_file(rfile);
}
break;
case mev_CHANGEREMOTEDIR:
n=remote_files[scroll_selection];
if (n[0]=='')
{
n=n+2;
sscanf(n,"%s",rfile);
change_remote_directory(rfile);
}
break;
case mev_CHANGELOCALDIR:
n=local_files[scroll_selection];
if (n[0]=='')
{
n=n+2;
sscanf(n,"%s",rfile);
sprintf(lfile,"%s/%s",current_local_path,rfile);
chdir(lfile);
getcwd(rfile,FMSIZE);
if (!strncmp("/dev",rfile,4))
{
if ((rfile[5]=='u')&&(rfile[6]=='/'))
sprintf(current_local_path,"u:%s",rfile+6);
else
sprintf(current_local_path,"u:%s",rfile+4);
}else{
sprintf(current_local_path,"%s",rfile);
}
get_local_files();
if (local_files) free(local_files);
f=file_count;
local_files=extract_filenames(local_directory);
local_file_count=file_count;
file_count=f;
Change_scroll_list(Mainwindow, Local_fs, local_files, local_file_count+1);
rsrc_gaddr(0,Mainwindow,&a);
objc_draw(a,Local_path,0,scrn_x,scrn_y,scrn_w,scrn_h);
}
break;
}
}while(e!=mev_QUIT);
close_down(); // Shut down the GUI
return 0;
}